from sqlalchemy import Column, String, INTEGER

from sqlConfig import Base


class Dormitory(Base):
    """
     domitory的四个user填充顺序为从1到4，当有user移除时，后面的user自动移进填充前面的空位
     例：现有user1,user2,user3被使用
        user1移除后,原user2成为现user1，原user3成为现user2
    """
    __tablename__ = 'dormitory'

    dormitoryId = Column(String(12), primary_key=True)

    user1 = Column(String(12))

    user2 = Column(String(12))

    user3 = Column(String(12))

    user4 = Column(String(12))

    def __init__(self, dormitoryId, user1, user2, user3, user4):
        self.dormitoryId = dormitoryId
        self.user1 = user1
        self.user2 = user2
        self.user3 = user3
        self.user4 = user4

